In recent years, there have been proposed various apparatuses which perform stereoscopic display in movies, games, and the like. For example, there is an apparatus which takes an image of a virtual three-dimensional space by a virtual stereo camera, generates an image for left eye and an image for right eye, and shifts these images to render the virtual three-dimensional space, thereby stereoscopically displaying three-dimensional objects in the virtual three-dimensional space.
In a conventional apparatus, when a two-dimensional object such as a menu, a subtitle, or an icon which does not exist within a virtual three-dimensional space is stereoscopically displayed together with a three-dimensional object in the virtual three-dimensional space, a rendering process is performed so that the two-dimensional object is displayed always closer to a user in a depth direction than the three-dimensional object because the two-dimensional object has no depth value. Consequently, in the conventional apparatus, it is difficult to represent a two-dimensional object naturally without giving a user a sense of discomfort when the two-dimensional object is stereoscopically displayed together with a three-dimensional object. That is, it is difficult to achieve a visual effect for causing a two-dimensional object that does not exist within a virtual three-dimensional space to be viewed as if it exists in the virtual three-dimensional space.
Therefore, an object of an exemplary embodiment is to provide a storage medium having stored therein a display control program, a display control apparatus, a display control system, and a display control method which can, when a two-dimensional object that is not in a virtual three-dimensional space is stereoscopically displayed together with a three-dimensional object positioned in the virtual three-dimensional space, stereoscopically display the two-dimensional object naturally without giving a user a sense of discomfort.
The storage medium having stored therein the display control program of the exemplary embodiment is a storage medium having stored therein a display control program to be executed by a computer of a display control apparatus which stereoscopically displays a predetermined two-dimensional object on a display device. The display control program causes the computer to execute: obtaining a depth value in accordance with a state of a virtual three-dimensional space captured by a virtual stereo camera; synthesizing an image for left eye and an image for right eye which are obtained by shifting the two-dimensional object, in order to generate parallax, by a shift amount in accordance with the obtained depth value, with an image for left eye and an image for right eye which are obtained by capturing a predetermined three-dimensional object positioned in the virtual three-dimensional space by the virtual stereo camera, respectively, and rendering the respective synthesized images, thereby generating a stereoscopic image; and stereoscopically displaying the generated stereoscopic image on the display device.
According to this configuration, the two-dimensional object is stereoscopically displayed at a depth position in accordance with the state of the virtual three-dimensional space. For example, a two-dimensional object is shifted by a depth value which a three-dimensional object has, thereby the two-dimensional object is stereoscopically displayed at the same depth position as the three-dimensional object. Consequently, when a two-dimensional object that does not exist within a virtual three-dimensional space is stereoscopically displayed together with a three-dimensional object in the virtual three-dimensional space, the two-dimensional object can be stereoscopically displayed naturally without giving a user a sense of discomfort. Examples of the two-dimensional object are a two-dimensional image originally having no depth value, and a two-dimensional image having no depth value, which is obtained by projecting a three-dimensional object using orthogonal projection.
The computer may be further caused to execute setting a parameter, other than the depth value, relating to display of the predetermined two-dimensional object.
According to this configuration, a parameter (e.g. the size or the shape of the two-dimensional object) other than the depth value of the two-dimensional object is set. Consequently, a mode of the two-dimensional object can be changed flexibly without being affected by the state of the virtual three-dimensional space. That is, the size, the shape, and the like of the two-dimensional object can be controlled regardless of (independent from) the depth position at which the two-dimensional object appears to be stereoscopically displayed.
The parameter may be a parameter representing a size of the predetermined two-dimensional object. In this case, the size of the predetermined two-dimensional object can be set without being affected by change in the depth position of the predetermined two-dimensional object.
The parameter representing the size of the predetermined two-dimensional object may be maintained constant. Because only the depth value of the predetermined two-dimensional object is affected by the state of the virtual three-dimensional space, even when the depth position of the predetermined two-dimensional object is changed, the size of the predetermined two-dimensional object can be maintained constant.
A parameter representing a display area of the predetermined two-dimensional object may be set based on a display position of the predetermined three-dimensional object in a two-dimensional coordinate system on a screen of the display device.
According to this configuration, the display area of the predetermined two-dimensional object is determined based on the position, on the screen of the display device, at which the predetermined three-dimensional object is displayed. Consequently, information represented by the predetermined two-dimensional object can be effectively provided to the user.
When it is assumed that the display area of the predetermined two-dimensional object is determined based on the relationship between the predetermined two-dimensional object and the predetermined three-dimensional object in the virtual three-dimensional space which is a three-dimensional coordinate system, because the virtual three-dimensional space is projected using perspective projection by the virtual stereo camera, the size of the display area of the predetermined two-dimensional object may change in accordance with the distance from the virtual stereo camera. On the other hand, according to the above configuration, a display area of the predetermined two-dimensional object is determined based on the display position of the predetermined three-dimensional object on the screen of the display device, that is, the display position of the predetermined three-dimensional object in the two-dimensional coordinate system. Consequently, for example, when the depth value is assigned to the predetermined two-dimensional object so as to be positioned at the same depth position as the predetermined three-dimensional object, the size (width of the display area) of the predetermined two-dimensional object can be prevented from being changed in accordance with the distance between the virtual stereo camera and the predetermined three-dimensional object.
When it is assumed that a virtual screen having a size corresponding to the screen of the display device is positioned between the virtual stereo camera and the predetermined three-dimensional object, the display area of the predetermined two-dimensional object may be determined based on two-dimensional coordinates, on a plane including the virtual screen, at which a line segment that connects a viewpoint position of the virtual stereo camera and the predetermined three-dimensional object intersects with the plane.
According to this configuration, the display area of the predetermined two-dimensional object can be determined easily.
A depth value may be obtained in accordance with a distance between a viewpoint position of the virtual stereo camera and the predetermined three-dimensional object in the virtual three-dimensional space.
According to this configuration, the predetermined two-dimensional object can be stereoscopically displayed in accordance with the depth position of the predetermined three-dimensional object. That is, a predetermined two-dimensional object that does not exist within a virtual three-dimensional space can be represented naturally being positioned at the same depth position as a predetermined object in the virtual three-dimensional space.
A camera-to-camera distance that is a distance between two virtual cameras which configure the virtual stereo camera can be changed in accordance with an operation on the display control apparatus. In this case, a parameter representing a display area of the predetermined two-dimensional object is updated in accordance with the change in the camera-to-camera distance.
The stereoscopic effect of the predetermined three-dimensional object is changed in accordance with the camera-to-camera distance being changed. The shift amount is calculated in accordance with the camera-to-camera distance, and thus the stereoscopic effect of the predetermined two-dimensional object is also changed in the same manner. Consequently, according to the above configuration, the relationship between the stereoscopic effect of the predetermined three-dimensional object and the stereoscopic effect of the predetermined two-dimensional object can be maintained constant.
The computer may be further caused to execute associating the obtained depth value with the predetermined two-dimensional object. In this case, the stereoscopic image is generated by using the associated depth value.
According to this configuration, the obtained depth value is associated with the two-dimensional object, and thus a stereoscopic image can be generated appropriately even when a plurality of two-dimensional objects exist, for example.
Images may be synthesized while the depth value associated with the predetermined two-dimensional object is compared with the depth value of the predetermined three-dimensional object, by using a Z buffer.
According to this configuration, it is possible to easily prevent an image from being stereoscopically displayed in a manner such that the depth values of the respective objects are inconsistent, for example, as in a case of an image in which the two-dimensional object is stereoscopically displayed deeper in the depth direction than the three-dimensional object in the virtual three-dimensional space even though the two-dimensional object is associated with the depth value so as to be stereoscopically displayed closer to the user in the depth direction than the three-dimensional object.
When a Z value of a target object to be rendered is smaller than the Z value of the two-dimensional object or the Z value of the three-dimensional object stored in the Z buffer, the target object is rendered.
According to this configuration, for example, when a target object (a three-dimensional object or a two-dimensional object) is stereoscopically displayed so as to be closer to the user in a depth direction than another object, the target object can be prevent from being stereoscopically displayed farther from the user in the depth direction than the other object.
The predetermined two-dimensional object may be a taken image including a human face captured by an imaging section.
According to this configuration, a visual effect for causing the human face that does not exist within the virtual three-dimensional space to be viewed as if it exists in the virtual three-dimensional space can be exerted.
The predetermined two-dimensional object may be a taken image obtained by an imaging section in real time.
According to this configuration, a display content of the taken image is changed over time. Consequently, a visual effect for causing the two-dimensional object that does not exist within the virtual three-dimensional space to be viewed as if it exists in the virtual three-dimensional space and moves in the virtual three-dimensional space can be easily exerted. The imaging section may be provided in the display control apparatus or may be provided in an external apparatus other than the display control apparatus.
The predetermined two-dimensional object may be obtained by the display control apparatus communicating with an external apparatus.
According to this configuration, a visual effect for causing the two-dimensional object that the display control apparatus does not have, to be viewed as if it exists in the virtual three-dimensional space constructed in the display control apparatus can be obtained.
The exemplary embodiment may be realized as a display control apparatus which stereoscopically displays a predetermined two-dimensional object on a display device. The display control apparatus includes an obtaining unit, a generation unit, and a display control unit. The obtaining unit obtains a depth value in accordance with a state of a virtual three-dimensional space captured by a virtual stereo camera. The generation unit synthesizes an image for left eye and an image for right eye which are obtained by shifting the two-dimensional object, in order to generate parallax, by a shift amount in accordance with the depth value obtained by the obtaining unit, with an image for left eye and an image for right eye which are obtained by capturing a predetermined three-dimensional object positioned in the virtual three-dimensional space by the virtual stereo camera, respectively, and renders the respective synthesized images, thereby generating a stereoscopic image. The display control unit stereoscopically displays the stereoscopic image generated by the generation unit on the display device.
The exemplary embodiment may be realized as a display control system which stereoscopically displays a predetermined two-dimensional object on a display device. The display control system includes an obtaining unit, a generation unit, and a display control unit. The obtaining unit obtains a depth value in accordance with a state of a virtual three-dimensional space captured by a virtual stereo camera. The generation unit synthesizes an image for left eye and an image for right eye which are obtained by shifting the two-dimensional object, in order to generate parallax, by a shift amount in accordance with the depth value obtained by the obtaining unit, with an image for left eye and an image for right eye which are obtained by capturing a predetermined three-dimensional object positioned in the virtual three-dimensional space by the virtual stereo camera, respectively, and renders the respective synthesized images, thereby generating a stereoscopic image. The display control unit stereoscopically displays the stereoscopic image generated by the generation unit on the display device.
The exemplary embodiment may be realized as display control method for stereoscopically displaying a predetermined two-dimensional object on a display device. In the display control method, firstly, a depth value is obtained in accordance with a state of a virtual three-dimensional space captured by a virtual stereo camera. Then, an image for left eye and an image for right eye which are obtained by shifting the two-dimensional object, in order to generate parallax, by a shift amount in accordance with the obtained depth value, are synthesized with an image for left eye and an image for right eye which are obtained by capturing a predetermined three-dimensional object positioned in the virtual three-dimensional space by the virtual stereo camera, respectively, and the respective synthesized images are rendered, thereby a stereoscopic image is generated. The stereoscopic image generated as above is outputted to the display device and stereoscopically displayed.
According to the exemplary embodiment, when a two-dimensional object that does not exist within a virtual three-dimensional space is stereoscopically displayed together with a three-dimensional object in the virtual three-dimensional space, the two-dimensional object can be stereoscopically displayed naturally without giving the user a sense of discomfort.
These and other objects, features, aspects and advantages of the exemplary embodiment will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.